using System.ComponentModel.DataAnnotations;

namespace RBAC.Domain.Dto.Input
{
    /// <summary>
    /// 更新部门输入Dto
    /// </summary>
    public class UpdateDepartmentInputDto
    {
        /// <summary>
        /// 部门ID
        /// </summary>
        [Required(ErrorMessage = "部门ID不能为空")]
        [Range(1, long.MaxValue, ErrorMessage = "部门ID必须大于0")]
        public long Id { get; set; }

        /// <summary>
        /// 部门名称
        /// </summary>
        [Required(ErrorMessage = "部门名称不能为空")]
        [StringLength(50, ErrorMessage = "部门名称长度不能超过50个字符")]
        public string DepartmentName { get; set; } = string.Empty;

        /// <summary>
        /// 父部门ID
        /// </summary>
        public long? ParentId { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        [Range(0, int.MaxValue, ErrorMessage = "排序值必须大于等于0")]
        public int? Sort { get; set; }

        /// <summary>
        /// 部门状态 1启用 0禁用
        /// </summary>
        [Range(0, 1, ErrorMessage = "部门状态只能是0(禁用)或1(启用)")]
        public int Status { get; set; } = 1;
    }
}